<?

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
           $_SESSION["OPASS"],
           $_SESSION["SID"],
           _NO_COMMENT);

if($Db->connect()){

  $_POST["memoEnt"] = (!empty($_POST["memoEnt"]))? $_POST["memoEnt"] : "default";

?>

  <?=$GJs->includeThis(_TYPE_CSS,"/ecs/myMenu.css") ?>
  <?=$GJs->includeThis(_TYPE_JS ,"/ecs/javascript/GMisc.js") ?>
  <?=$GJs->includeThis(_TYPE_JS ,"/ecs/javascript/GAjax.js") ?>
  <?=$GJs->includeThis(_TYPE_JS ,"javascript/misc.js") ?>
  <?=$GJs->includeThis(_TYPE_JS ,"javascript/ajax.js") ?>
  <?=$GJs->stopRKey() ?>

  <SCRIPT LANGUAGE="JavaScript" SRC="../javascript/CalendarPopup.js"></SCRIPT>
  <SCRIPT LANGUAGE="JavaScript">
  var cal      = new CalendarPopup();
  </SCRIPT>

  <body>
  <form name  ="initMe" action=entry.php method=post>

  <table border="1" class="dedeq" >
  <tr>

    <td class="solid"> DATE
      <input type="submit"
             onClick="cal.select(document.forms['initMe'].trDateEnt,
                                 'anchor1',
                                 'dd-MM-yyyy');
                      return false;"
             NAME   ="anchor1"
             ID     ="anchor1"
             value  ="Select"> </td>
        <td > <?=$GHtml->formInput("trDateEnt",
                                   $_POST["trDateEnt"],
                                   $Misc->stdProperties()) ?> </td>

  </tr>
  <tr>

    <td class="solid"> Memo </td>
    <td> <?=$GHtml->formTextArea("memoEnt",
                                 $_POST["memoEnt"],
                                 $Misc->stdProperties()) ?> </td>

  </tr>
  </table><br/>
<?
  if($_SESSION["modify_mode"] == "Y"){


  }else{


  }
?>

  <table border="1" class="dedeq">
  <tr>
  <th> No       </th>
  <th> Drop     </th>
  <th> Model    </th>
  <th> ModelId  </th>
  <th> Compos   </th>
  </tr>

  <?for($iRow = 0; $iRow < $_SESSION["init_num"] ; $iRow++): ?>

    <?$lstModel  =  $Misc->retArray($_POST["modelEnt"][$iRow]) ?>

    <?$propModel =  $GJs->jsOnFocus("GMisc.setYellow2(this);
                                     Ajax.model(this);").

                    $GJs->jsOnBlur ("GMisc.setWhite2(this);") ?>

    <?$propModelId = $GJs->jsOnFocus("GMisc.setYellow2(this);
                                      Ajax.modelId(\"modelEnt[".$iRow."]\",
                                                   this);").

                     $GJs->jsOnBlur ("GMisc.setWhite2(this);"); ?>

    <?$propCompos = $GJs->jsOnFocus("GMisc.setYellow2(this);
                                     Ajax.snEntry(\"modelEnt[".$iRow."]\",
                                                  \"modelIdEnt[".$iRow."]\",
                                                  \"qtyEnt[".$iRow."]\",
                                                  \"".$_SESSION["tmpJid"]."\",
                                                  \"fromEnt\",
                                                  \"".$_SERVER["HTTP_HOST"]."\");").

                    $GJs->jsOnBlur ("GMisc.setWhite2(this);"); ?>

    <tr>

    <td> <?=($iRow+1) ?> </td>

    <td> <?=$GHtml->formCheckBox("dropBox[]",
                            ($iRow + 1),
                            _NO_PROPERTY) ?> </td>

    <td> <?=$GHtml->formDropDown("modelEnt[".$iRow."]",
                                 $_POST["modelEnt"][$iRow],
                                 $lstModel,
                                 $propModel) ?> </td>

    <td> <?=$GHtml->formInput("modelIdEnt[".$iRow."]",
                              $_POST["modelIdEnt"][$iRow],
                              $Misc->stdProperties()) ?> </td>

    <td> <?=$GHtml->formInputButton("Entry",
                                    "composEnt[".$iRow."]",
                                    $_POST["composEnt"][$iRow],
                                    $propCompos) ?> </td>

    </tr>
  <?endfor; ?>

  </table><br/>

  <?=$GHtml->formInputButton("Entry-data",
                             "entry",
                             "Entry-data",
                             $stlButton) ?>

  <?=$GHtml->formInputButton("Add-row",
                             "addrow",
                             "Add-row",
                             $stlButton) ?>

  <?=$GHtml->formInputButton("Drop-row",
                             "droprow",
                             "Drop-row",
                             $stlButton) ?>

  </form>
  </body>
<?

  $Db->dc();
}else{

  $Misc->usrDie(_DB_CONN_ERROR);
}

?>